import i18n from '@src/locales';
import './FormSelect.scss';

import FormSelectSetting from './FormSelectSetting.vue';
import FormSelectPreview from './FormSelectPreview.vue';
import FormSelect from './FormSelect.vue';

// 产品类型
import ProductTypeExtendSetting from './extend/ProductTypeExtendSetting.vue';
// 客户团队
import CustomerTagsExtendSetting from './extend/CustomerTagsExtendSetting.vue';
import CustomerExtend from './extend/CustomerExtend.vue'
// 工单优先级
import TaskExtendSetting from './extend/TaskExtendSetting.vue';
// 下拉高级搜索
import FormSelectSearch from './extend/FormSelectSearch.vue';
// 产品类型质保规则
import ProductTypeQualityBuild from './extend/ProductTypeQualityBuild.vue'
import ProductTypeQualityStartTime from './extend/ProductTypeQualityStartTime.vue'
import SolveStatusSetting from './extend/SolveStatusSetting.vue'
// 服务商管理
import ServiceManageAuthorizationSetting from './extend/ServiceManageAuthorizationSetting';
import ServiceManageGradeSetting from './extend/ServiceManageGradeSetting';
import ServiceManageRoleSetting from "./extend/ServiceManageRoleSetting";

// 故障库---解决方案表单的知识库
import FaultLibraryKnowledgeSetting from './extend/FaultLibraryKnowledgeSetting';
import FormSelectViewKnowledge from './FormSelectViewKnowledge';
import FormSelect2Build from './FormSelect2Build';


let FormSelectField = {
  formType: 'select', // 字段类型
  name: i18n.t('common.form.type.select'),
  isSystem: 0,
  component: {
    setting: FormSelectSetting,
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      'product_type_setting': ProductTypeExtendSetting,
      'customer_tags_setting': CustomerTagsExtendSetting,
      'customer_extend': CustomerExtend,
      'select_search': FormSelectSearch,
      'product_menu_qualityTime_build': ProductTypeQualityBuild,
      'product_type_qualityTime_build': ProductTypeQualityBuild,
      'select_qualityTime_search': ProductTypeQualityBuild,
      'product_type_quality_startTime': ProductTypeQualityStartTime,
      'select_qualityStartTime_search': ProductTypeQualityStartTime,
      'service_provider_providerType_setting': FormSelectSetting,
      'service_provider_role_setting': ServiceManageRoleSetting,
    }
  }
};

let TaskLevelField = {
  formType: 'level', // 字段类型
  fieldName: 'level',
  name: i18n.t('common.form.type.level'),
  isSystem: 1,
  forceDelete: true,
  component: {
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      'task_level_setting': TaskExtendSetting,
      'event_level_setting': TaskExtendSetting
    }
  }
}

const TaskServiceTypeField = {
  formType: 'serviceType',
  fieldName: 'serviceType',
  name: i18n.t('common.form.type.serviceType'),
  isSystem: 1,
  forceDelete: true,
  component: {
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      'task_serviceType_setting': TaskExtendSetting
    }
  }
}

const TaskServiceContentField = {
  formType: 'serviceContent',
  fieldName: 'serviceContent',
  name: i18n.t('common.form.type.serviceContent'),
  isSystem: 1,
  forceDelete: true,
  component: {
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      'task_serviceContent_setting': TaskExtendSetting
    }
  }
}

const ServiceRemarkSolveStatusField = {
  formType: 'solveStatus',
  fieldName: 'solveStatus',
  name: i18n.t('common.form.type.solveStatus'),
  previewIcon: 'icon-bulb',
  isSystem: 1,
  component: {
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      remark_solveStatus_setting: SolveStatusSetting
    }
  }
}

const ServiceManageAuthorizationLevelField = {
  formType: 'provideQuality',
  fieldName: 'provideQuality',
  name: i18n.t('common.form.type.provideQuality'),
  previewIcon: 'icon-shoucang',
  isSystem: 1,
  forceDelete: true,
  component: {
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      'service_provider_provideQuality_setting': ServiceManageGradeSetting
    }
  }
}
const ServiceManageTechnicalGradeField = {
  formType: 'engineerQuality',
  fieldName: 'engineerQuality',
  name: i18n.t('common.form.type.engineerQuality'),
  previewIcon: 'icon-fdn-user',
  forceDelete: true,
  isSystem: 1,
  component: {
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      'service_engineer_engineerQuality_setting': ServiceManageGradeSetting
    }
  }
}
const ServiceManageAuthorizeTaskTypeField = {
  formType: 'authorizeTask',
  fieldName: 'authorizeTask',
  name: i18n.t('common.form.type.authorizeTask'),
  previewIcon: 'icon-gongdan',
  forceDelete: true,
  isSystem: 1,
  component: {
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      'service_provider_authorizeTask_setting': ServiceManageAuthorizationSetting,
      'service_engineer_authorizeTask_setting': ServiceManageAuthorizationSetting
    }
  }
}
const ServiceManageAuthorizeProductTypeField = {
  formType: 'authorizeProduct',
  fieldName: 'authorizeProduct',
  name: i18n.t('common.form.type.authorizeProduct'),
  previewIcon: 'icon-chanpin',
  forceDelete: true,
  isSystem: 1,
  component: {
    preview: FormSelectPreview,
    build: FormSelect,
    extend: {
      'service_provider_authorizeProduct_setting': ServiceManageAuthorizationSetting,
      'service_engineer_authorizeProduct_setting': ServiceManageAuthorizationSetting
    }
  }
}

let FormKnowledgeField = {
  formType: 'knowledge', // 字段类型
  fieldName: 'knowledge',
  name: i18n.t('common.tabs.wiki'),
  previewIcon: 'icon-zhishiku1',
  isSystem: 1,
  forceDelete: true,
  component: {
    preview: FormSelectPreview,
    build: FormSelect2Build,
    view: FormSelectViewKnowledge,
    extend: {
      'fault_library_knowledge_setting': FaultLibraryKnowledgeSetting,
      'event_knowledge_setting': FaultLibraryKnowledgeSetting,
    }
  }
};


export default [
  FormSelectField, 
  TaskLevelField,
  TaskServiceTypeField,
  TaskServiceContentField,
  ServiceRemarkSolveStatusField, // 服务备注表单：解决状态
  ServiceManageAuthorizationLevelField, // 服务商表单： 服务商资质
  ServiceManageTechnicalGradeField, // 服务商表单： 工程师资质
  ServiceManageAuthorizeTaskTypeField, // 服务商表单： 授权工单类型
  ServiceManageAuthorizeProductTypeField, // 服务商表单： 授权产品目录
  FormKnowledgeField, //故障库的解决方案表单：知识库
];


